home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / MapMaster.lha / mapmaster / clanguagesupport / mapexample / MapExample.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-18  |  2.1 KB  |  58 lines

  1. /***************************************/
  2. /* Example of using MapFunctions  v1.0 */
  3. /* Written by Kelly Samel              */
  4. /* Email- samel@telusplanet.net        */    
  5. /***************************************/
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <intuition/intuition.h>
  9. #include <graphics/gfx.h>
  10. #include <mapmaster/mapfunctions.h> /* Include file for MapFunctions */
  11. #include <clib/intuition_protos.h>
  12. #include <clib/graphics_protos.h>
  13. #include <clib/exec_protos.h>
  14. #include <clib/dos_protos.h>
  15.  
  16. int mapdata[241]; /* mapdata[] must be defined Global and must */
  17.                   /* be large enough to hold your maps         */
  18.                   /* horizblocks*vertblocks+1                  */
  19.  
  20. /***************************************************************************/
  21. /*         ------------------ Start Of Main ---------------                */
  22. /***************************************************************************/
  23. main()
  24. {
  25. struct BitMap mybitmap; /* BitMap to hold your blocks */
  26. char blocksfile[]="dungeonblocks.iff"; /* name of iff file containing
  27.                                           your blocks */
  28. char mapfile[]="dungeonblocks.map"; /* name of mapmaster map file */
  29.  
  30. /* Structure for the screen */
  31. struct Screen *screen1;
  32.  
  33. /* Open the Screen */
  34. screen1=OpenScreenTags (NULL,SA_DisplayID,LORES_KEY,
  35. SA_Depth,4,SA_Title,(ULONG)"our screen",TAG_DONE);
  36.  
  37. /* -Instructions on using these functions- */
  38. /* First load the map                      */
  39. /* Then get the blocks                     */
  40. /* Then get the color palette -Optional-   */
  41. /* and finally paste the map to the screen */
  42. /* Free the memory GetBlocks took          */
  43.  
  44. LoadMap(mapfile,20,12);
  45. GetBlocks(blocksfile,&mybitmap,4,320,200);
  46. GetBlocksPalette(blocksfile,screen1); 
  47. PasteBlocks(20,12,16,16,1,0,0,&mybitmap,&screen1->BitMap);
  48. FreeBlocks(&mybitmap,4);
  49.  
  50. Delay(5*60); /* wait for awhile */
  51.  
  52. /* Close everything we opened */
  53. CloseScreen(screen1);
  54. }
  55. /***************************************************************************/
  56. /*         ------------------ End Of Main ---------------                  */
  57. /***************************************************************************/
  58.